package com.zhanglijie.improve.aqs.exclusive.interupt;

import java.util.concurrent.locks.LockSupport;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/10/19 0019 0:37
 */
public class InterruptPark {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            System.out.println("执行中"+Thread.currentThread());
            LockSupport.park();
            System.out.println("继续执行");
            LockSupport.park();
            LockSupport.park();
            System.out.println("中断后后面park N 次都失效");
        });
        t1.start();
        Thread.sleep(4000);
        t1.interrupt();
    }
}
